package com.bookstore.mapper;

import com.bookstore.domain.OrderDetails;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
@Mapper
public interface OrderDetailsMapper {
    //获取所有订单信息
    @Select("select * from b_order_details")
    public List<OrderDetails> findAll();

    //根据订单号来获取
    @Select("select * from b_order_details where orderId=#{orderId}")
    public List<OrderDetails> findByOrderId(@Param("orderId") String orderId);

    //添加订单信息
    @Insert("Insert into b_order_details values(#{orderId},#{bid},#{bCount})")
    public Integer addOrderDetails(OrderDetails orderDetails);
}
